evtchn: optimize XSM ssid field
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Mon, 24 Mar 2014 09:55:26 +0000 (10:55 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 24 Mar 2014 09:55:26 +0000 (10:55 +0100)
commita3e12a091147a0804b55c73064beb7e11785ab04
treebfdb08433ba769f5274e035935c9cf2c5cf0ef96
parent98bef9974d9b39fbb7d052c50db950435f0b2513
evtchn: optimize XSM ssid field

When FLASK is the only enabled implementation of the XSM hooks in Xen,
some of the abstractions required to handle multiple XSM providers are
redundant and only produce unneeded overhead.  This patch reduces the
memory overhead of enabling XSM on event channels by replacing the
untyped ssid pointer from struct evtchn with a union containing the
contents of the structure.  This avoids an additional heap allocation
for every event channel, and on 64-bit systems, reduces the size of
struct evtchn by 4 bytes.  If an out-of-tree XSM module needs the full
flexibility of the generic evtcnn ssid pointer, defining the symbol
XSM_NEED_GENERIC_EVTCHN_SSID will include a suitable pointer field.

This also cleans up the unused selinux_checkreqprot declaration left
from the Linux port.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/include/xen/sched.h
xen/xsm/flask/hooks.c
xen/xsm/flask/include/objsec.h